package com.cx.bank.view;

import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

/**
 * @description:
 * @author:gong
 * @create: 13/7/2022 下午6:08
 */
public class MyDailog extends JDialog {
    private String money;
    public MyDailog() {
        setVisible(true);
        setBounds(300, 300, 300, 200);
        Container container = this.getContentPane();
        container.setLayout(null);
        JLabel jLabel = new JLabel("请输入金额：");
        money = jLabel.getText();
        JTextField jTextField = new JTextField(20);
        jLabel.setBounds(30, 30, 100, 100);
        JButton jButton = new JButton("确认");
        container.add(jLabel);
        container.add(jTextField);
        container.add(jButton);
//        container.setBackground(Color.CYAN);
        jButton.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                container.setVisible(false);
            }
        });
    }

    public String getMoney() {
        return money;
    }

    public void setMoney(String money) {
        this.money = money;
    }
}
